package com.jiangjun.fetch.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.jiangjun.fetch.mongo.MongoDBSupport;
import com.mongodb.DBCursor;

@WebServlet(name = "GetColumnServlet", urlPatterns = "/getColumnService", asyncSupported = false)
@WebInitParam(name = "default_charset", value = "utf-8")
public class GetColumnServlet extends HttpServlet{

	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		MongoDBSupport mongoDBSupport = MongoDBSupport.getInstance();
		DBCursor dbCursor = mongoDBSupport.queryCollection(MongoDBSupport._FETCHRSS);
		System.out.println(dbCursor.toArray().toString());
	}
}
